<?php
/*
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 */
$styleSheet = "orange";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="../../scripts/archive.js"></script>
<script type="text/javascript" src="../../scripts/time.js"></script>

<link href="../../themes/<?php echo $styleSheet;?>/css/leave.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../themes/<?php echo $styleSheet;?>/scripts/style.js"></script>
<link href="../../themes/<?php echo $styleSheet;?>/css/style.css" rel="stylesheet" type="text/css"/>
<!--[if lte IE 6]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE6_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<!--[if IE]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<script>
function doHandleAll() {
	with (document.frmListOfShifts) {
		if(elements['allCheck'].checked == false){
			doUnCheckAll();
		}
		else if(elements['allCheck'].checked == true){
			doCheckAll();
		}
	}
}

function doCheckAll() {
	with (document.frmListOfShifts) {
		for (var i=0; i < elements.length; i++) {
			if (elements[i].type == 'checkbox') {
				elements[i].checked = true;
			}
		}
	}
}

function doUnCheckAll() {
	with (document.frmListOfShifts) {
		for (var i=0; i < elements.length; i++) {
			if (elements[i].type == 'checkbox') {
				elements[i].checked = false;
			}
		}
	}
}
function deleteComfirn(obj) {
	if(confirm('你确定要删除吗')) {
		obj.form.action.value='delete';
		obj.form.submit(); 
	}
}
</script>
</head>
<body class="yui-skin-sam">

<div class="outerbox">
    <div class="outerbox"><div class="top"><div class="left"></div><div class="right"></div><div class="middle"></div></div><div class="maincontent">
        <div class="mainHeading"><h2><font color="#ff0000"></font> 账号管理</h2></div>
		<font color="Red" ><?php echo $records['message'] ?></font>

   <div class="actionbar">
        <div class="actionbuttons">

    <br class="clear">
        <br class="clear">
    </div>
    <br class="clear">
    <form id="frmListOfShifts" name="frmListOfShifts" method="post" action="?ctrl=user">
	<INPUT TYPE="hidden" NAME="action" value=''> 
    关键词：<INPUT TYPE="text" NAME="keyWord" value='<?php echo $records['keyWord'];?>'> &nbsp;&nbsp;&nbsp;<INPUT TYPE="submit" value='搜索'>	 <br/>
	<input type="button" value="删除" onclick="deleteComfirn(this);" />    
	<table cellspacing="0" cellpadding="0" class="data-table">
        <thead>
            <tr>
                <td scope="col"><input type="checkbox" class="checkbox" name="allCheck" value="" onclick="doHandleAll();" /></td>
                <td scope="col">账号名</td>
                <td scope="col">姓名</td>
                <td scope="col">所属部门</td>
                <td scope="col">操作</td>
            </tr>
        </thead>
        <tbody>
            <?php
            $reslut = $records['list']; 
//            print_r($records);
            if(is_array($reslut) && count($reslut)>0){
                foreach($reslut as $key => $val){
                	if ($val['user_name']==$records['myUser']) {
                		continue;
                	}
                	$group_name='无'; 
                    echo '<tr>
		                    <td scope="col"><input type="checkbox" id="Approval" name="userids[]" value="'.$val['user_name'].'" /></td>
		                    <td scope="col">'.$val['user_name'].'</td>
		                    <td scope="col">'.$val['first_name'].$val['last_name'].'</td>
		                    <td scope="col">'.$val['department'].'</td> 
		                    <td scope="col"><a  href="?ctrl=user&action=editOneShow&username='.$val['user_name'].'">编辑</a></td> 

                    </tr>';
                }
            }else{
                echo "<tr><td  colspan=\"8\" style=\"color:red;text-align:center;padding:10px;\">当前操作没有审批信息</td></tr>";
            }
            ?>
        </tbody>
       </table> 
      </form>
  </div><div class="bottom"><div class="left"></div><div class="right"></div><div class="middle"></div></div></div>
</div>


<script language="javascript" >

</script>
</body>
</html>
